package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

//设施表
@TableName("t_facility")
public class FacilityBean {
    /*设施id*/
    @TableId(value = "pk_facilityId", type = IdType.AUTO)
    private Integer id;
    /*设施损坏信息*/
    @TableField("f_msg")
    private String msg;
    /*损坏日期*/
    @TableField("f_time")
    private LocalDate time = LocalDate.now();
    /*解决状态*/
    @TableField("f_state")
    private String state = "未解决";
    @TableField("fk_roomId")
    private Integer roomId;


    /*房间*/
    @TableField(exist = false)
    private RoomBean roomBean;

    public FacilityBean() {
    }

    public FacilityBean(String msg, Integer roomId) {
        this.msg = msg;
        this.roomId = roomId;
        this.roomBean = new RoomBean();
        this.roomBean.setId(roomId);
    }

    @Override
    public String toString() {
        return "FacilityBean{" +
                "id=" + id +
                ", msg='" + msg + '\'' +
                ", time=" + time +
                ", state='" + state + '\'' +
                ", roomId=" + roomId +
                ", roomBean=" + roomBean +
                "\n";
    }

    public Integer getRoomId() {
        return roomId;
    }

    public void setRoomId(Integer roomId) {
        this.roomId = roomId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public LocalDate getTime() {
        return time;
    }

    public void setTime(LocalDate time) {
        this.time = time;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public RoomBean getRoomBean() {
        return roomBean;
    }

    public void setRoomBean(RoomBean roomBean) {
        this.roomBean = roomBean;
    }
}
